<template>
  <div v-loading="pageLoading" style="padding-left:24px">
    <el-input v-model.trim="chaxun" size="medium" style="margin-bottom:20px;width:192px" placeholder="按赛事名称进行搜索" clearable @input="onCheck" />
    <el-button type="primary" style="margin-left:12px;" size="small" @click="check">查询</el-button>
    <div class="tab">
      <el-table :data="tableData" :border="false">
        <el-table-column label="赛事名称" min-width="206">
          <template slot-scope="{row}">
            <el-popover placement="bottom" width="280" trigger="hover" :content="row.competitionName">
              <p slot="reference" class="gloryyname">
                {{ row.competitionName }}
              </p>
            </el-popover>
          </template>
        </el-table-column>
        <el-table-column label="项目级别" min-width="306">
          <template slot-scope="{row}">
            <el-popover placement="bottom" width="280" trigger="hover" :content="row.eventLongName">
              <p slot="reference" class="gloryy">
                {{ row.eventLongName }}
              </p>
            </el-popover>
          </template>
        </el-table-column>
        <el-table-column label="奖杯">
          <template slot-scope="{row}">
            {{ row.rankDes }}
          </template>
        </el-table-column>
      </el-table>
    </div>
    <el-row class="gl_pt_20" style="text-align: right;">
      <el-pagination
        :current-page="Api_GET_EventsManagementEventResultRegisterHonorQO.Page"
        :page-size="Api_GET_EventsManagementEventResultRegisterHonorQO.MaxResultCount"
        :total="total"
        layout="total,sizes,prev,pager,next,jumper"
        :page-sizes="[10, 20, 30, 40]"
        @size-change="sizeChange"
        @current-change="pageIndexChange"
      />
    </el-row>
  </div>
</template>
<script>
import { Api_GET_EventsManagementEventResultRegisterHonorQO } from '@/lib/form/game/swaggerForm';
import { api_GET_EventsManagementEventResultRegisterHonor } from '@/extend/api/gameswaggerApi/app';
export default {
  data() {
    return {
      Api_GET_EventsManagementEventResultRegisterHonorQO: new Api_GET_EventsManagementEventResultRegisterHonorQO(),
      chaxun: '',
      tableData: [],
      total: 0,
      pageLoading: false
    };
  },
  created() {
    this.getPointRank();
  },
  methods: {
    // 获取个人荣耀列表
    getPointRank(page) {
      this.pageLoading = true;
      this.Api_GET_EventsManagementEventResultRegisterHonorQO.Page = page || 1;
      this.Api_GET_EventsManagementEventResultRegisterHonorQO.RegisterId = this.$route.query.pid;
      this.Api_GET_EventsManagementEventResultRegisterHonorQO.TopRank = null;
      this.Api_GET_EventsManagementEventResultRegisterHonorQO.SkipCount = (this.Api_GET_EventsManagementEventResultRegisterHonorQO.Page - 1) * this.Api_GET_EventsManagementEventResultRegisterHonorQO.MaxResultCount;
      api_GET_EventsManagementEventResultRegisterHonor(this.Api_GET_EventsManagementEventResultRegisterHonorQO).then((res) => {
        this.tableData = res.items;
        this.total = res.totalCount;
        this.pageLoading = false;
      }, error => {
        this.loading = false;
        const _msg = error.error.message || error.message;
        this.$message({ type: 'error', message: _msg });
      });
    },
    sizeChange(MaxResultCount) {
      this.Api_GET_EventsManagementEventResultRegisterHonorQO.MaxResultCount = MaxResultCount;
      this.getPointRank();
    },
    pageIndexChange(currentPage) {
      this.Api_GET_EventsManagementEventResultRegisterHonorQO.Page = currentPage;
      this.getPointRank(currentPage);
    },
    check() {
      this.Api_GET_EventsManagementEventResultRegisterHonorQO.Keyword = this.chaxun;
      this.getPointRank();
    },
    onCheck() {
      this.Api_GET_EventsManagementEventResultRegisterHonorQO.Keyword = this.chaxun;
      this.getPointRank();
    }
  }
};
</script>
<style lang="scss" scoped>
.tab{
    border-radius: 15px;
    overflow: hidden;
    box-shadow:0px 0px 15px #e0dada;
    padding-top: 20px;
    padding-left: 10px;
    padding-right: 12px;
}
.ditu{
    display: inline-block;
    width: 31px;
    height: 36px;
    text-align: center;
    line-height: 36px;
}
.ditu1{
    background-image:url(../../assets/images/league/rank_1.png);
    background-size: 103%;
}
.ditu2{
    background-image:url(../../assets/images/league/rank_2.png);
    background-size: 103%;
}
.ditu3{
    background-image:url(../../assets/images/league/rank_3.png);
    background-size: 103%;
}
.roodsPhoto{
    width: 48px;
    height: 48px;
    border-radius: 50%;
  }
//去掉表格竖线
/deep/.el-table_header td,/deep/.el-table td,/deep/.el-table th{
    border-right: 0px;
}
/deep/.el-table{
    border: 0px;
    border-radius: 10px;
    border-right: 0px !important;
}
/deep/.el-input--medium .el-input__inner{
  height: 32px;
}
.gloryy{
  display: inline-block;
  max-width: 384px;
  white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.gloryyname{
  display: inline-block;
  max-width: 237px;
  white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
</style>
